home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / ubiquity / base-installer / kernel.sh
Encoding:
Text File  |  2007-04-12  |  2.2 KB  |  106 lines

  1. arch_get_kernel_flavour () {
  2.     VENDOR=`grep '^vendor_id' "$CPUINFO" | head -n1 | cut -d: -f2`
  3.     FAMILY=`grep '^cpu family' "$CPUINFO" | head -n1 | cut -d: -f2`
  4.     case "$VENDOR" in
  5.         " AuthenticAMD"*)
  6.             case "$FAMILY" in
  7.                 " 6"|" 15")    echo k7 ;;
  8.                 " 5")        echo k6 ;;
  9.                 *)        echo 386 ;;
  10.             esac
  11.         ;;
  12.         " GenuineIntel"|" GenuineTMx86"*|" CentaurHauls"*)
  13.             case "$FAMILY" in
  14.                 " 6"|" 15")    echo 686 ;;
  15.                 " 5")        echo 586tsc ;;
  16.                 *)        echo 386 ;;
  17.             esac
  18.         ;;
  19.         *) echo 386 ;;
  20.     esac
  21.     return 0
  22. }
  23.  
  24. arch_check_usable_kernel () {
  25.     if expr "$1" : '.*-server.*' >/dev/null; then return 0; fi
  26.     if expr "$1" : '.*-386.*' >/dev/null; then return 0; fi
  27.     if [ "$2" = 386 ]; then return 1; fi
  28.     if expr "$1" : '.*-generic.*' >/dev/null; then return 0; fi
  29.     if expr "$1" : '.*-586.*' >/dev/null; then return 0; fi
  30.     if [ "$2" = 586tsc ]; then return 1; fi
  31.     if [ "$2" = 686 ]; then
  32.         if expr "$1" : '.*-686.*' >/dev/null; then return 0; fi
  33.         return 1
  34.     fi
  35.     if expr "$1" : '.*-k6.*' >/dev/null; then return 0; fi
  36.     if [ "$2" = k6 ]; then return 1; fi
  37.     if expr "$1" : '.*-k7.*' >/dev/null; then return 0; fi
  38.  
  39.     # default to usable in case of strangeness
  40.     warning "Unknown kernel usability: $1 / $2"
  41.     return 0
  42. }
  43.  
  44. arch_get_kernel_etch () {
  45.     if [ "$KERNEL_MAJOR" = 2.4 ]; then
  46.         # Kernel images are identical with Sarge
  47.         return
  48.     else
  49.         imgbase=linux-image
  50.     fi
  51.  
  52.     if [ "$1" = k7 ]; then
  53.         set k6
  54.     fi
  55.     if [ "$1" = k6 ]; then
  56.         set 586tsc
  57.     fi
  58.  
  59.     if [ "$1" = 686 ]; then
  60.         set 586tsc
  61.     fi
  62.     if [ "$1" = 586tsc ]; then
  63.         echo "linux-generic"
  64.         echo "linux-image-generic"
  65.         set 386
  66.     fi
  67.     echo "linux-386"
  68.     echo "linux-image-386"
  69.  
  70.     echo "linux-server"
  71.     echo "linux-image-server"
  72.     echo "linux-server-bigiron"
  73.     echo "linux-image-server-bigiron"
  74. }
  75.  
  76. arch_get_kernel_sarge () {
  77.     imgbase=kernel-image
  78.  
  79.     if [ "$1" = k7 ]; then
  80.         echo "$imgbase-$KERNEL_MAJOR-k7"
  81.         set k6
  82.     fi
  83.     if [ "$1" = k6 ]; then
  84.         if [ "$KERNEL_MAJOR" = 2.4 ]; then
  85.             echo "$imgbase-$KERNEL_MAJOR-k6"
  86.         fi
  87.         set 586tsc
  88.     fi
  89.  
  90.     if [ "$1" = 686 ]; then
  91.         echo "$imgbase-$KERNEL_MAJOR-686"
  92.         set 586tsc
  93.     fi
  94.     if [ "$1" = 586tsc ]; then
  95.         if [ "$KERNEL_MAJOR" = 2.4 ]; then
  96.             echo "$imgbase-$KERNEL_MAJOR-586tsc"
  97.         fi
  98.         set 386
  99.     fi
  100.     echo "$imgbase-$KERNEL_MAJOR-386"
  101. }
  102.  
  103. arch_get_kernel () {
  104.     arch_get_kernel_etch "$1"
  105. }
  106.